﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>00: MessageBox Test</title>
	<style type="text/css">
		body, html {
			width: 100%;
			height: 100%;
			margin: 0;
			overflow: hidden;
			font-family: "Segoe UI", Arial, Verdana;
			font-size: 9pt;
			background-color: #F1F1F1;
		}
	</style>
	<script src="../../../bootloader.js" type="text/javascript"></script>
	<script src="../source/MessageBox.js" type="text/javascript"></script>
	<!-- -->
	<!-- -->
	<script type="text/javascript">
		go = function() {
			view = new opus.View({
				styles: {border: 8, padding: 4, borderColor: "green"},
				layoutKind: "vbox",
				controls: [

					{type: "Button", caption: "AlertSimple", w: 100, onclick: "alertboxSimple"},
					{type: "Button", caption: "Alert", w: 100, onclick: "alertbox"},
					{type: "Button", caption: "Prompt", w: 100, onclick: "promptbox"},
					{name: "info", caption: "info", w: "100%", h: "100%"}
				],
				alertboxSimple: function(inSender) {
					/*p = opus.MessageBox.getBox(this, {}, {type: "opus.Aristo.Window", h: 150, w: 300}, {type: "opus.Aristo.AlertBoxContent"});
					p.openAtCenter();*/
					p = this.alertBox;
					if (!p) {
						p = this.alertBox = inSender.owner.createComponent({type: "Popup", h: 150, w: 300, styles: {border: 0},
							chrome: [
								{type: "Aristo.Window", clientLayoutKind: "vbox", h: "100%", w: "100%", controls: [
									{name: "message", content: "Alert", height: "100%", width: "100%", styles: {padding: 8}},
									{name: "controls", height: 36, width: "100%", styles: {padding: 4, fontSize: "9pt"}, controls: [
										{type: "Button", name: "okButton", width: 92, horizontalAlign: "center", caption: "OK", onclick: "okClick"}
									]}
								]},
							],
							okClick: function(inSender) {
								console.log("close");
								p.close();
							}
						});
						p.render();
					}
					p.openAtCenter();
				},
				alertbox: function() {
					opus.MessageBox.alert(this, "Achtung", "Hi,I'm really happy to see you");
				},
				promptbox: function() {
					var p = opus.MessageBox.getBox();
				}
			});
		}
	</script>
</head>
<body onload="go()">
</body>
</html>
